package com.lg.distributed.transaction.message.config;

import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 该配置文件 不能 跟，rabbit全局配置写在一起，不然会导致循环依赖问题
 * @author by Mr. Li 2020/12/12 14:09
 */
@Configuration
public class MyRabbitMqJsonConfig {
    /**
     * 将rabbit序列化 转换成json
     * 默认是java的序列化
     *
     * @return
     */
    @Bean
    public MessageConverter messageConverter() {
        return new Jackson2JsonMessageConverter();
    }
}
